package com.wyd.factory;

import com.wyd.factory.product.ProductA;
import com.wyd.factory.product.ProductB;

/**
 * @author Yudi Wang
 * @date 2022/1/27 15:51
 */
public class Client {
    private Factory factory;

    public Client(Factory factory) {
        this.factory = factory;
    }

    public void setFactory(Factory factory) {
        this.factory = factory;
    }

    public void getProduct(){
        ProductB productB = factory.creatProductB();
        ProductA productA = factory.creatProductA();
        System.out.println("productA" + productA);
        System.out.println("productB" + productB);
    }
}
